The present invention is concerned with video coding.
According to the present invention there is provided a method of video coding comprising                a) dividing a sequence to be encoded into a plurality of temporal portions;        b) analysing the sequence to determine for each portion, in accordance with a plurality of encoding quality settings, data establishing the relationship between the quality settings and (i) a quality metric for the portion and (ii) the number of bits generated by encoding the portion at that quality setting;        c) analysing the data along with a target quality and target bit rate to choose a set of quality settings, one per portion, that tends to minimise a combined quality cost for the sequence within the constraint that transmission of encoded video at the target bit rate via transmitting and receiving buffers of specified size and initial receiver buffer fullness shall not cause underflow nor overflow; wherein the combined quality cost is the sum of individual quality costs each of which is a function of the amount of deviation of the quality metric of the respective encoded portion from the target quality, the function being such that the cost generally increases as the absolute value of the deviation increases; andencoding the sequence using the chosen quality settings.        
Other aspects of the invention are defined in the claims